'''
@Author: your name
@Date: 2020-03-24 13:15:43
@LastEditTime: 2020-03-24 13:19:24
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: \giee\learn_python\从零开始学python\python高级编程\随手练习\互斥锁.py
'''
'''
@Author: your name
@Date: 2020-03-24 13:15:43
@LastEditTime: 2020-03-24 13:17:58
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: \giee\learn_python\从零开始学python\python高级编程\随手练习\互斥锁.py
'''
import threading
import time

def sing():
    """唱歌5秒"""

    for i in range(5):
        print("----正在唱歌第{}秒".format(i))
        time.sleep(1)

def dance():
    """跳舞5秒"""

    for i in range(5):
        print("正在跳舞第{}秒----".format(i))
        time.sleep(1)

def main():
    t1 = threading.Thread(target=sing)
    t2 = threading.Thread(target=dance)
    t1.start()
    t2.start()

    print(threading.enumerate())
    
if __name__ == "__main__":
    main()
